#include "Bullet.h"


Bullet::Bullet(int a, int b,short c)
{
	x = a;
    y = b;
    speed = 10;
    is_alive = 1;
    type = c;
    loadimage(&img[0], "resource/images/bullet1.png");
    loadimage(&img[1], "resource/images/bullet2.png");
}

void Bullet::draw()
{
    if (is_alive)
    {
        drawAlpha(x, y, &img[type]);
    }
        

}

void Bullet::move()
{
    if (is_alive)
    {
        y -= speed;
        if (y < 0)
        {
            is_alive = 0;
        }
    }
}

void Bullet::resetPosition(int a,int b)
{
    x = a;
    y = b;
    is_alive = true;
}

